import Vue from 'vue'
import App from './App'

Vue.config.productionTip = false

import card from '@/components/common/card.vue';
Vue.component('card',card)

import toast from '@/components/common/toast.vue';
Vue.component('toast',toast)

import $H from '@/common/request.js';
import store from 'store/index.js';

Vue.prototype.$H=$H
Vue.prototype.$store=store
Vue.prototype.authJump=(options)=>{
	if(!store.state.token){
		uni.showToast({
			title: '请先登录',
			icon: 'none'
		});
		return uni.navigateTo({
			url:'/pages/login/login'
		})
	}
	uni.navigateTo(options)
}
// Vue.prototype.authMethod=(callback)=>{
// 	if(!store.token){
// 		uni.showToast({
// 			title: '请先登录',
// 			icon: 'none'
// 		});
// 		return uni.reLaunch({
// 			url:'/pages/login/login'
// 		})
// 	}
// 	callback()
// }



App.mpType = 'app'

const app = new Vue({
    ...App
})
app.$mount()
